package com.mornd.gulimall.product.entity.vo.spusave;

import com.mornd.gulimall.apis.coupon.to.MemberPriceTo;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author: mornd
 * @dateTime: 2023/8/3 - 21:40
 * sku 列表
 */

@Getter
@Setter
public class SkuVo {

    @NotEmpty(message = "销售属性集合不能为空")
    private List<@Valid SaleVo> sales;


    @NotBlank(message = "商品名称不能为空")
    @Size(max = 255)
    private String skuName;

    @Size(max = 255)
    private String skuTitle;

    @Size(max = 1000)
    private String skuSubtitle;

    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格不能低于{value}")
    private BigDecimal price;


    @NotEmpty(message = "sku图集不能为空")
    private List<@Valid ImageVo> selectedImages;

    // ignore
    private List<String> descar;

    @Size(max = 1000)
    private String skuDesc;

    // 满多少件
    @Min(0)
    private int fullCount;

    // 打几折
    @Min(0)
    private BigDecimal discount;

    // 可叠加优惠
    @Range(max = 1)
    private int discountAppend;

    // 满多少元
    @Min(0)
    private BigDecimal fullPrice;

    // 减多少元
    @Min(0)
    private BigDecimal reducePrice;

    @Range(max = 1)
    private int fullAppend;

    private List<@Valid MemberPriceTo> memberPrice;
}
